package com.ht.web_vr_home_tour_backend.obj.dto;

import com.ht.web_vr_home_tour_backend.obj.enums.UserLevel;
import com.ht.web_vr_home_tour_backend.obj.pojo.UserInfo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
@ApiModel("用户信息传输对象")
public class UserInfoDto {
    @ApiModelProperty("用户ID")
    String id;

    @ApiModelProperty("用户名")
    String username;

    @ApiModelProperty("用户头像")
    String avatar;

    @ApiModelProperty("用户昵称")
    String nickName;

    @ApiModelProperty("用户等级-权限控制")
    UserLevel level;

    public UserInfoDto() {
    }

    public UserInfoDto(UserInfo userFromDb) {
        this.id = userFromDb.getId().toString();
        this.username = userFromDb.getUsername();
        this.avatar = userFromDb.getAvatar();
        this.nickName = userFromDb.getNickName();
        this.level = userFromDb.getLevel();
    }
}
